package com.yoomiito.app.present.my.activity;

import com.yoomiito.app.base.AppConfig;
import com.yoomiito.app.base.BaseActPresenter;
import com.yoomiito.app.model.bean.MyTeamSaleBean;
import com.yoomiito.app.model.bean.SaleBean;
import com.yoomiito.app.net.YmApi;
import com.yoomiito.app.ui.my.MySaleActivity;
import com.yoomiito.app.ui.my.MyTeamSaleActivity;

import cn.droidlover.xdroidmvp.net.ApiException;
import cn.droidlover.xdroidmvp.net.ApiSubscriber;
import cn.droidlover.xdroidmvp.net.XApi;

public class MyTeamSalePresenter extends BaseActPresenter<MyTeamSaleActivity> {

    public MyTeamSalePresenter(AppConfig appConfig) {
        super(appConfig);
    }




    public void getTeamRecord(int page,String date) {
        YmApi.getYmService()
                .getTeamRecord(date,page)
                .compose(getV().bindToLifecycle())
                .compose(XApi.<MyTeamSaleBean>getApiTransformerData())
                .compose(XApi.<MyTeamSaleBean>getScheduler())
                .subscribe(new ApiSubscriber<MyTeamSaleBean>(handleException()) {
                    @Override
                    public void onSuccess(MyTeamSaleBean data) {
                        getV().setData(data.data);
                    }
                    @Override
                    public void onFail(ApiException error) {
                    }
                });
    }




}
